package org.example.utils;

public class ThreadLocalUtil {
    public static final ThreadLocal THREAD_LOCAL = new ThreadLocal();

    //获取数据
    public static <T> T get(){
        return (T) THREAD_LOCAL.get();
    }

    //存储数据
    public static void set(Object value){
        THREAD_LOCAL.set(value);
    }

    //清除THREAD_LOCAL中的数据，防止内存溢出
    public static void remove(){
        THREAD_LOCAL.remove();
    }


}
